import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '项目ID',
    align: 'center',
    dataIndex: 'projectId'
  },
  {
    title: '用户ID',
    align: 'center',
    dataIndex: 'userId'
  },
  {
    title: 'sdk名称',
    align: 'center',
    dataIndex: 'sdkName'
  },
  {
    title: '代码位ID',
    align: 'center',
    dataIndex: 'slotId'
  },
  {
    title: 'levelTag',
    align: 'center',
    dataIndex: 'levelTag'
  },
  {
    title: 'ecpm',
    align: 'center',
    dataIndex: 'ecpm'
  },
  {
    title: '设备序号',
    align: 'center',
    width: '200px',
    dataIndex: 'deviceId'
  },
  {
    title: 'biddingType',
    align: 'center',
    dataIndex: 'biddingType'
  },
  {
    title: 'errorMsg',
    align: 'center',
    dataIndex: 'errorMsg'
  },
  {
    title: '请求唯一标识',
    align: 'center',
    dataIndex: 'requestId',
  },
  {
    title: 'ritType',
    align: 'center',
    dataIndex: 'ritType',
  },
  {
    title: 'segmentId',
    align: 'center',
    dataIndex: 'segmentId',
  },
  {
    title: '渠道 ',
    align:"center",
    dataIndex: 'channel',
  },
  {
    title: 'subChannel',
    align:"center",
    dataIndex: 'subChannel',
  },
  {
    title: 'abtestId',
    align: 'center',
    dataIndex: 'abtestId',
  },
  {
    title: 'scenarioId',
    align: 'center',
    dataIndex: 'scenarioId',
  },
  {
    title: '创建日期',
    align: 'center',
    dataIndex: 'createTime',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: 'projectId',
    field: 'projectId',
    component: 'Input',
  },
  {
    label: 'userId',
    field: 'userId',
    component: 'Input',
  },
  {
    label: 'sdkName',
    field: 'sdkName',
    component: 'Input',
  },
  {
    label: 'slotId',
    field: 'slotId',
    component: 'Input',
  },
  {
    label: 'levelTag',
    field: 'levelTag',
    component: 'Input',
  },
  {
    label: 'ecpm',
    field: 'ecpm',
    component: 'Input',
  },
  {
    label: 'biddingType',
    field: 'biddingType',
    component: 'Input',
  },
  {
    label: 'errorMsg',
    field: 'errorMsg',
    component: 'InputTextArea',
  },
  {
    label: 'requestId',
    field: 'requestId',
    component: 'Input',
  },
  {
    label: 'ritType',
    field: 'ritType',
    component: 'Input',
  },
  {
    label: 'segmentId',
    field: 'segmentId',
    component: 'Input',
  },
  {
    label: 'channel',
    field: 'channel',
    component: 'Input',
  },
  {
    label: 'subChannel',
    field: 'subChannel',
    component: 'Input',
  },
  {
    label: 'abtestId',
    field: 'abtestId',
    component: 'Input',
  },
  {
    label: 'scenarioId',
    field: 'scenarioId',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  projectId: { title: 'projectId', order: 0, view: 'text', type: 'string' },
  userId: { title: 'userId', order: 1, view: 'text', type: 'string' },
  sdkName: { title: 'sdkName', order: 2, view: 'text', type: 'string' },
  slotId: { title: 'slotId', order: 3, view: 'text', type: 'string' },
  levelTag: { title: 'levelTag', order: 4, view: 'text', type: 'string' },
  ecpm: { title: 'ecpm', order: 5, view: 'text', type: 'string' },
  biddingType: { title: 'biddingType', order: 6, view: 'text', type: 'string' },
  errorMsg: { title: 'errorMsg', order: 7, view: 'textarea', type: 'string' },
  requestId: { title: 'requestId', order: 8, view: 'text', type: 'string' },
  ritType: { title: 'ritType', order: 9, view: 'text', type: 'string' },
  segmentId: { title: 'segmentId', order: 10, view: 'text', type: 'string' },
  channel: { title: 'channel', order: 11, view: 'text', type: 'string' },
  subChannel: { title: 'subChannel', order: 12, view: 'text', type: 'string' },
  abtestId: { title: 'abtestId', order: 13, view: 'text', type: 'string' },
  scenarioId: { title: 'scenarioId', order: 14, view: 'text', type: 'string' },
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}